<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        function qx() {
            var arr = document.getElementsByClassName("gou");
            for (var i = 0; i < arr.length; i++) {
                arr[i].checked = true;
            }
        }
        function qbx() {
            var arr = document.getElementsByClassName("gou");
            for (var i = 0; i < arr.length; i++) {
                arr[i].checked = false;
            }
        }
        function fx() {
            var arr = document.getElementsByClassName("gou");
            for (var i = 0; i < arr.length; i++) {
                if (arr[i].checked==false){
                    arr[i].checked = true;
                } else {
                    arr[i].checked = false;
                }
            }
        }
        function delh() {
            var arr = document.getElementsByClassName("gou");
            for (var i = 0; i < arr.length; i++) {
                if (arr[i].checked){
                    var a = arr[i].parentNode;
                    a = a.parentNode;
                    a.innerHTML = "";
                    i--;
                }
            }
        }
    </script>
</head>
<body>
<table border="1" cellpadding="1" cellspacing="1">
    <th class="xx">姓名</th>
    <th class="xx">年龄</th>
    <th class="xx">地址</th>
    <th class="xx">操作</th>
    <tr >
        <td>张三</td>
        <td>27</td>
        <td>上海</td>
        <td><input type="checkbox" class="gou"></td>
    </tr>
    <tr >
        <td>小强</td>
        <td>26</td>
        <td>北京</td>
        <td><input type="checkbox" class="gou"></td>
    </tr>
    <tr >
        <td>李四</td>
        <td>29</td>
        <td>广州</td>
        <td><input type="checkbox" class="gou"></td>
    </tr>
    <tr>
        <td>孙八</td>
        <td>23</td>
        <td>南京</td>
        <td><input type="checkbox" class="gou"></td>
    </tr>
    <tr>
        <td>二麻子</td>
        <td>19</td>
        <td>大连</td>
        <td><input type="checkbox" class="gou"></td>
    </tr>
    <tr>
        <td>犀利姐</td>
        <td>32</td>
        <td>青岛</td>
        <td><input type="checkbox" class="gou"></td>
    </tr>
</table>
<button onclick="delh()">删除选中行</button>
<button onclick="qx()">全选</button><br>
<button onclick="qbx()">全不选</button>
<button onclick="fx()">反选</button>
</body>
</html>